package com.xbts.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.xbts.common.exception.ServiceException;
import com.xbts.common.utils.WordUtils;
import com.xbts.system.domain.*;
import com.xbts.system.domain.dto.CnContractManagerDTO;
import com.xbts.system.mapper.SysUserInvoiceInformationMapper;
import com.xbts.system.service.ISysUserInvoiceInformationService;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.xbts.common.utils.DateUtils;
import com.xbts.common.utils.SecurityUtils;
import org.springframework.util.CollectionUtils;

import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;

/**
 * 在线用户 服务层处理
 *
 * @author xbts
 */
@Service
public class SysUserInvoiceInformationImpl extends ServiceImpl<SysUserInvoiceInformationMapper, SysUserInvoiceInformation> implements ISysUserInvoiceInformationService
{
    /**
     * 保存或更新用户发票信息
     *
     * @param sysUserInvoiceInformation 发票信息
     * @return 结果
     */
    @Override
    public boolean insertOrUpdateInformation(SysUserInvoiceInformation sysUserInvoiceInformation){
        sysUserInvoiceInformation.setCreateBy(SecurityUtils.getUserId().toString());
        sysUserInvoiceInformation.setUserId(SecurityUtils.getUserId());
        return saveOrUpdate(sysUserInvoiceInformation);
    }

    /**
     * 查询用户发票信息
     *
     * @param
     * @return 结果
     */
    @Override
    public List<SysUserInvoiceInformation> getInvoiceInformation(){
         QueryWrapper queryWrapper = new QueryWrapper();
         return list(queryWrapper);
     }

}
